WIP: DOC/Figure.paragraph: Add a gallery example to show formating long text as paragraphs #4592
WIP: DOC/Figure.paragraph: Add a gallery example to show formating long text as paragraphs #4592yvonnefroehlich wants to merge 8 commits intomainfrom
Conversation
I think it makes more sense to have a separate example.
I feel these are technical details that users don't have to know, especially for PyGMT users who are not familiar with GMT CLI syntax. |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
| Paragraph | ||
| ========= |
There was a problem hiding this comment.
| Paragraph | |
| ========= | |
| Paragraphs of long text | |
| ======================= |
| Paragraph | ||
| ========= | ||
|
|
||
| To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph` |
There was a problem hiding this comment.
| To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph` | |
| To typeset long text as one or several paragraphs the :meth:`pygmt.Figure.paragraph` |
|
|
||
| To plot longer text as one or several paragraphs the :meth:`pygmt.Figure.paragraph` | ||
| method can be used. The ``parwidth`` and ``linespacing`` parameters allow to set | ||
| the line length and spacing of the paragraph, respectively.` The desired text can |
There was a problem hiding this comment.
| the line length and spacing of the paragraph, respectively.` The desired text can | |
| the width of the paragraph and line spacing, respectively. The desired text can |
|
Maybe we can try to recreate the GMT example/test at https://github.com/GenericMappingTools/gmt/blob/master/test/pstext/shade_text.sh.
|
Looks like a nice example, but I think it would be good to use a text that consists of at least two paragraphs. |

Description of proposed changes
This PR aims to add a gallery example to show the usage of the newly added high-level method
Figure.paragraph.Currently this is a standalone example. I am a bit wondering if it can make sense to add this to the already existing gallery example Formatting text because
Figure.paragraphis related to -M ofFigure.text.Please note the upstream bug reported in #4590. I will write a related GMT code example and issue hopefully this night or tomorrow - Edit Upstream bug report at GenericMappingTools/gmt#8989 - Edit 2026/04/22 PR with a fix in the GMT codes was merged.
Preview: https://pygmt-dev--4592.org.readthedocs.build/en/4592/gallery/embellishments/paragraph.html
Guidelines
Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash command is:
/format: automatically format and lint the code